#ifndef __FRAME_CLASS__
#define __FRAME_CLASS__

#include <iostream>
#include <cstring>
#include <opencv2/core/core.hpp>
#include <opencv2/opencv.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/videoio/videoio.hpp>
#include <opencv2/video.hpp>
#include <opencv2/imgproc/imgproc.hpp>

#define VIDEO_PATH  8
#define KEYBOARD_1  49
#define KEYBOARD_2  50
#define KEYBOARD_3  51


class FrameClass{
public:
	FrameClass();
	~FrameClass();
	bool OpenVideo(int DeviceID);
	bool ReadImage(void);
	void SetROI(int a,int b);
	void SplitChannels(int ch);
	void Blur(void);
	void Threshold(void);
	void FindContours(void);
	void ShowSrcImage(std::string WindowName = "SRC");
	void ShowChannelImage(std::string WindowName = "CH");
	void ShowBinaryImage(std::string WindowName = "BIN");
	void ShowRoiImage(std::string WindowName = "ROI");
	void DrawContours(void);
	void SaveImage(std::string Path = "./SaveImage/");
public:
	cv::VideoCapture capture;
	cv::Mat SrcImg;
	cv::Mat RoiImg;
	cv::Mat U8C1Img;
	cv::Mat BlurImg;
	cv::Mat BinaryImg;
	int width;
	int height;
	int cropWidth;
	int cropHeight;
	int x;
	int y;
	std::vector<std::vector<cv::Point>>contours;
	std::vector<cv::Vec4i> hirearchy;
	std::vector<cv::Mat> Channels;
	int thresholdMin;
	int thresholdMax;
	int areaMin;
	int areaMax;
};


#endif //__FRAME_CLASS__
